package com.zhanghp.industry;

import com.zhanghp.factory.KingdomFactory;
import lombok.NoArgsConstructor;

/**
 * @author zhanghp
 * @date 2022-08-05 16:49
 */
@NoArgsConstructor
public class FactoryIndustry {

    /**
     * 国家
     */
    private final Kingdom kingdom = new Kingdom();

    /**
     * 获取王国
     *
     * @return 国家
     */
    public Kingdom getKingdom() {
        return this.kingdom;
    }

    /**
     * 制造国家
     *
     * @param type 种族类型
     */
    public void createKingdom(Kingdom.FactoryMaker.KingdomType type) {
        // 国家诞生
        KingdomFactory kingdomFactory = Kingdom.FactoryMaker.makeFartory(type);
        // 设置王位
        kingdom.setKing(kingdomFactory.createKing());
        // 制造城堡
        kingdom.setCastle(kingdomFactory.createCastle());
        // 制造武器
        kingdom.setArmy(kingdomFactory.createArmy());
    }
}
